package com.drmswt.cnCaptcha.server.service.impl;

import com.drmswt.cnCaptcha.server.mapper.PersonMapper;
import com.drmswt.cnCaptcha.server.model.Person;
import com.drmswt.cnCaptcha.server.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by wangcan2 on 2016/3/23.
 */
@Service
public class PersonService implements IPersonService
{
    @Autowired
    private PersonMapper personMapper;

    @Override
    public Person getPersonById(int id)
    {
        return personMapper.findById(id);
    }

    @Override
    public boolean addPerson()
    {
        Person person = new Person().setName("test1").setSex(0).setDelFlag(false);

        return this.personMapper.add(person);
    }
}
